<?php if ($removed): ?>
	<p>Issue has been resolved.</p>
<?php endif; ?>

<?php if ($reportobject): ?>
	<h3 style="margin-top: 0;">Complaints for <?php _e($reportobject['title']) ?></h3>
	<table>
	<tr><th>Type</th><th>Additional Comments</th><th>Reporter</th><th>Time</th></tr>
	<?php foreach ($objectreports as $i): ?>
		<tr><td><?php _e($reportstrings[$i['report_type']]) ?></td><td>
		<?php if ($i['comments']): ?>
			<?php echo nl2br(htmlspecialchars($i['comments'])) ?>
		<?php else: ?>
			<em>None</em>
		<?php endif; ?></td><td><a href="<?php echo Gene::makeLink(Gene::userId($i['name'])) ?>"><?php _e($i['name']) ?></a></td><td><?php echo makedate($i['report_time']) ?></td></tr>
	<?php endforeach; ?>
	</table>
	
	<?php $this->display ("objects/discussioncomment/embed", array("object" => $reportobject)) ?>
	
	<form action="<?php echo Gene::makeLink($object) ?>/edit/reports" method="post">
	<p><input type="hidden" name="object" value="<?php echo $i['object_id'] ?>" /><input type="submit" value="Resolved" /></p>
	</form>
	
	<hr />
	
	<h3>Other Reports</h3>
<?php endif; ?>

<?php if (count($reports)): ?>
	<p>There have been unresolved complaints about the following comments:</p>
	
	<?php if ($reportobject): ?>
		<ul>
		<?php foreach ($reports as $i): ?>
			<?php if ($i['object_id'] == $reportobject['object_id']): ?>
				<li><strong><?php _e($i['title']) ?> (Reports: <?php _e($i['reports']) ?>)</strong></li>
			<?php else: ?>
				<li><a href="<?php echo addArguments(Gene::makeLink(Gene::objectId($object)).'/edit/reports', array('more' => $i['object_id'])) ?>"><?php _e($i['title']) ?> (Reports: <?php _e($i['reports']) ?>)</a></li>
			<?php endif; ?>
		<?php endforeach; ?>
		</ul>
	<?php else: ?>
		<table width="100%">
		<?php foreach ($reports as $i): ?>
			<tr><td>
			<h4><a href="<?php echo Gene::makeLink($i) ?>"><?php _e($i['title']) ?></a></h4>
			<?php $this->display ("objects/discussioncomment/embed", array("object" => $i)) ?>
			</td><td style="width: 100px; text-align: center;">
			<form action="<?php echo Gene::makeLink($object) ?>/edit/reports" method="post">
			<input type="hidden" name="object" value="<?php echo $i['object_id'] ?>" />Reports:<br />
			<a href="<?php echo addArguments(Gene::makeLink(Gene::objectId($object)).'/edit/reports', array('more' => $i['object_id'])) ?>" class="large"><?php echo $i['reports'] ?></a><br />
			<br /><input type="submit" value="Resolved" /></form></td></tr>
		<?php endforeach; ?>
		</table>
	<?php endif; ?>
<?php else: ?>
	<p>There are no unresolved complaints.</p>
<?php endif; ?>